#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int n;
    cin >> n;
    double house_x=0, house_y=0, house_people = 0;
    double tempMin = 0;
    double totalMin = 0;

    for (int i = 0; i < n; i++)
    {
        cin >> house_x >> house_y >> house_people;
        tempMin = (sqrt(pow(house_x, 2) + pow(house_y, 2)) / 50) * 2 + house_people*(1+0.5);
        totalMin += tempMin;
    }
    cout << ceil(totalMin);
    
    return 0;
}